#include "hpy.h"
#include <bits/stdc++.h>

using namespace std;

int main(int argc, char* argv[])
{
    registerGen(argc, argv, 1);
    auto [n, m, p] = tuple{opt<int>(1), opt<int>(2), opt<double>(3)};
    n = rnd.wnext(n / 2, n, 1) * 2;
    m = rnd.wnext(m / 2, m, 1) * 2;
    println(n, m);
    for(int i = 1; i <= n; i ++) {
        string s(m, '.');
        for(int j = 0; j < m; j ++)
            if(rnd.next() < p) s[j] = '#';
        println(s);
    }
}
